/**
 * @file   1132.cpp
 * @author Shuang Hu <hsmath@ubuntu>
 * @date   Wed May 12 23:04:20 2021
 * 
 * @brief  PAT 1132
 * 
 * 
 */
#include<iostream>
#include<string>
using namespace std;
int main(){
    int N;
    cin>>N;
    for(int i=0;i<N;i++){
	string s;
	cin>>s;
	int len=s.length();
	len=len/2;
	int d1=stoi(s);
	string s1=s.substr(0,len);
	string s2=s.substr(len,len);
	int d2=stoi(s1);
	int d3=stoi(s2);
	if(d2*d3==0){
	    cout<<"No"<<endl;
	    continue;
	}
	if(d1%(d2*d3)==0){
	    cout<<"Yes"<<endl;
	}else{
	    cout<<"No"<<endl;
	}
    }
}
